package com.cug.smartranch.animal.admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cug.smartranch.animal.admin.dto.req.AnimalPageQueryReqDTO;
import com.cug.smartranch.animal.admin.dto.req.FeedDetailPageQueryReqDTO;
import com.cug.smartranch.animal.admin.dto.resp.AnimalPageQueryRespDTO;
import com.cug.smartranch.animal.admin.dto.resp.FeedDetailPageQueryRespDTO;
import com.cug.smartranch.animal.admin.service.FeedDetailService;
import com.cug.smartranch.framework.result.Result;
import com.cug.smartranch.framework.web.Results;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 喂养详情控制层
 */
@RestController
@RequiredArgsConstructor
@Tag(name = "喂养详情管理")
@RequestMapping("/api/feed_admin/feedDetail")
public class FeedDetailController {
    private final FeedDetailService feedDetailService;
    @Operation(summary = "用户分页查询所有喂养详情信息")
    @GetMapping("/select/all")
    public Result<IPage<FeedDetailPageQueryRespDTO>> selectAllFeedDetail(FeedDetailPageQueryReqDTO requestParam) {
        IPage<FeedDetailPageQueryRespDTO> list = feedDetailService.selectAllFeedDetail(requestParam);
        return Results.success(list);
    }
}
